import request from "@/utils/request";

// 商品列表数据
export function getGoods(params) {
  return request({
    url: "goods",
    method: "GET",
    params,
  });
}

// 1.6.1. 商品分类数据列表
export function getCateList(params) {
  return request({
    url: "categories",
    method: "GET",
    params,
  });
}

// 添加分类
export function setCateList(data) {
  return request({
    url: "categories",
    method: "post",
    data,
  });
}

// 根据用户选择的三级分类和面板获取参数数据
export function paramsgetCateList(id, many) {
  return request({
    url: `categories/${id}/attributes`,
    method: "get",
    params: {
      sel: many,
    },
  });
}

// 添加动态参数或者静态属性
export function AddMoveQuiet(id, data) {
  return request({
    url: `categories/${id}/attributes`,
    method: "post",
    data,
  });
}

// 点击了编辑框的确定按钮
export function EditSubmission(id, attrId, data) {
  return request({
    url: `categories/${id}/attributes/${attrId}`,
    method: "put",
    data,
  });
}

// 删除动态参数的操作删除按钮
export function delThreeParameter(id, attrid) {
  return request({
    url: `categories/${id}/attributes/${attrid}`,
    method: "delete",
  });
}
